public class User {
    private String name;
    private String passWord;


    public void login(String name, String passWord) throws PassNameException, PassPasswordException {
        if (!this.name.equals(name)) {
            throw new PassNameException("用户名错误");
        }
        if (!this.passWord.equals(passWord)) {
            throw new PassPasswordException("密码错误");
        }
        System.out.println("登录成功！！！");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }
}
